package spring.cloud.service.task.analyzer;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.common.curator.Curator;
import spring.cloud.tasks.common.curator.CuratorInfo;

/**
 * 关键点
 * task_type 批次
 * 分片数(定义的不重要  实时的重要。)
 * 任务权重+执行器权重+执行器不高可用
 * <p>
 * 实时刻刻的执行情况 任务执行过程中的超时未跑  完成 失败及失败的原因 超时。
 */
@Slf4j
@Setter
@Getter
public class StatisticsAnalyzerModel {


    private TaskStatisticsAnalyzer taskStatisticsAnalyzer;
    private ExecutorInfoAnalyzer executorInfoAnalyzer;


    public TaskStatistics analyzeTaskStatistics(CuratorInfo curatorInfo, Curator curator, String job) throws Exception {
        return taskStatisticsAnalyzer.analyzeTaskStatistics(curator, curatorInfo, job, executorInfoAnalyzer);
    }

    public void analyzeExecutor(Curator curator, CuratorInfo curatorInfo) {
        executorInfoAnalyzer.analyzeExecutor(curator, curatorInfo);
    }


}
